import { http } from "@/utils/http";
import { baseUrlApi } from "../utils";

// 筛选客户群获取数据
export const SecuritiesClientGetSecurityClients = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesClient/GetSecurityClients"),
    {
      data
    }
  );
};

// 创建客户群
export const SecuritiesClientCreateSecuritiesClientBase = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesClient/CreateSecuritiesClientBase"),
    {
      data
    }
  );
};

// 获取客户群条件下拉框
export const SecuritiesClientGetClientBaseData = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesClient/GetClientBaseData"),
    {
      data
    }
  );
};

//根据客户群下拉框获取数据
export const SecuritiesClientGetSecuritiesConditionDataById = (
  params: string
) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesClient/GetSecuritiesConditionDataById?" + params)
  );
};

// 新建资产配置方案
export const SecuritiesPropertyConfigCreatePropertyConfig = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesPropertyConfig/CreatePropertyConfig"),
    { data }
  );
};

// 获取配置方案列表
export const SecuritiesPropertyConfigGetPropertyConfig = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesPropertyConfig/GetPropertyConfig"),
    { data }
  );
};

// 获取投资组合数据列表

export const FunDataGetFundDataByType = (data: object) => {
  return http.request<any>("post", baseUrlApi("/FunData/GetFundDataByType"), {
    data
  });
};

// 添加试算模拟年化率
export const FunDataCalculatedRateOfReturn = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/FunData/CalculatedRateOfReturn"),
    { data }
  );
};

// 获取投资组合列表
export const FunDataGetPortfolioData = (data: object) => {
  return http.request<any>("post", baseUrlApi("/FunData/GetPortfolioData"), {
    data
  });
};

// 购买投资组合
export const SecuritiesPortfolioPurchasedPortfolio = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesPortfolio/PurchasedPortfolio"),
    {
      data
    }
  );
};

// 获取资产组合详情
export const FunDataGetPortfolioDetailsData = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/FunData/GetPortfolioDetailsData"),
    {
      data
    }
  );
};

// 获取已购买的资产组合数据
export const SecuritiesPortfolioGetPurchasedPortfolioData = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesPortfolio/GetPurchasedPortfolioData"),
    {
      data
    }
  );
};

// 匹配投资组合
export const FunDataGetPortfolioDataByClientBaseId = (params: string) => {
  return http.request<any>(
    "post",
    baseUrlApi("/FunData/GetPortfolioDataByClientBaseId?" + params)
  );
};

// 风险预警
export const SecuritiesPortfolioRiskEarlyWarning = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesPortfolio/RiskEarlyWarning"),
    { data }
  );
};

// 调仓提示
export const SecuritiesPortfolioSendWarehouseTransferPrompt = (
  data: object
) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesPortfolio/SendWarehouseTransferPrompt"),
    { data }
  );
};

export const SecuritiesPortfolioGetAnalysisReport = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesPortfolio/GetAnalysisReport"),
    { data }
  );
};

// 获取基金分红列表
export const SecuritiesFundDividendGetAllFundDividend = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesFundDividend/GetAllFundDividend"),
    { data }
  );
};
// 获取我的基金
export const SecuritiesFundDividendGetMyFundDividend = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesFundDividend/GetMyFundDividend "),
    { data }
  );
};

// 购买基金
export const SecuritiesFundDividendPurchasedFundDividend = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesFundDividend/PurchasedFundDividend"),
    { data }
  );
};

// 基金分红
export const SecuritiesFundDividendGetMyFundDividendByCode = (
  params: string
) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesFundDividend/GetMyFundDividendByCode?" + params)
  );
};

// 基金赎回
export const SecuritiesFundDividendFundRedemption = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesFundDividend/FundRedemption"),
    { data }
  );
};

//税务筹划分析 -- 获取
export const SecuritiesFundDividendGetTaxPlanningAnalysisData = (
  params: string
) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesFundDividend/GetTaxPlanningAnalysisData?" + params)
  );
};

// 提交--税务筹划分析
export const SecuritiesFundDividendTaxPlanningAnalysis = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesFundDividend/TaxPlanningAnalysis"),
    { data }
  );
};

// 获取股票池信息

export const SecuritiesMyStrategyGetStockSelectionData = (params: string) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesMyStrategy/GetStockSelectionData?" + params)
  );
};

// 获取期货 商品池信息

export const SecuritiesMyStrategyGetFutureslectionData = (params: string) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesMyStrategy/GetFutureslectionData?" + params)
  );
};

//  股票 运行回测
export const SecuritiesMyStrategyStockBackTest = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesMyStrategy/StockBackTest"),
    { data }
  );
};

//  期货 运行回测
export const SecuritiesMyStrategyFutureskBackTest = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesMyStrategy/FutureskBackTest"),
    { data }
  );
};

// 保存策略
export const SecuritiesMyStrategyAddPolicy = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesMyStrategy/AddPolicy"),
    { data }
  );
};

// 获取策略列表
export const SecuritiesMyStrategyGetMyAllStrategyData = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesMyStrategy/GetMyAllStrategyData"),
    { data }
  );
};

// 回测成功获取数据折线图
export const SecuritiesMyStrategyGetStrategy = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesMyStrategy/GetStrategy"),
    { data }
  );
};
// 回测成功获取数据列表
export const SecuritiesMyStrategyGetAllTrans = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesMyStrategy/GetAllTrans"),
    { data }
  );
};

//查看策略【查看修改】
export const SecuritiesMyStrategySearchAndUpdateStrategy = (data: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/SecuritiesMyStrategy/SearchAndUpdateStrategy"),
    { data }
  );
};

// 提交已回测数据
export const SecuritiesMyStrategySendStrategy = (params: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/SecuritiesMyStrategy/SendStrategy?" + params)
  );
};

// 获取日期选择范围
export const SecuritiesMyStrategyGetStockPoolMaxTime = (params: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/SecuritiesMyStrategy/GetStockPoolMaxTime?" + params)
  );
};
